package com.yanqu.road.server.cmd.activity.unionwar;

import com.yanqu.road.pb.activity.unionwar.CrossUnionWarProto;
import com.yanqu.road.server.cmd.base.AbstractCommand;
import com.yanqu.road.server.command.Cmd;
import com.yanqu.road.server.gameplayer.GamePlayer;
import com.yanqu.road.server.manger.activity.unionwar.UnionWarActivityMgr;
import com.yanqu.road.message.YanQuMessage;
import com.yanqu.road.server.protocol.GameProtocol;

/**
 * @author ：zfr
 * @date ：2021/2/24 20:10
 */
@Cmd(code = GameProtocol.S_UNION_WAR_ACTIVITY_RECEIVE_CHAMPION_DATA, desc = "接受跨服发送的冠军商会数据")
public class UnionWarReceiveChampionDataCmd extends AbstractCommand {
    private CrossUnionWarProto.UnionWarChampionSyncListMsg msg;

    @Override
    public boolean parseData(YanQuMessage packet) throws Exception {
        msg = CrossUnionWarProto.UnionWarChampionSyncListMsg.parseFrom(packet.getBytes());
        return true;
    }

    @Override
    public void execute(GamePlayer player, YanQuMessage packet) throws Exception {
        UnionWarActivityMgr.addChampion(msg);
    }

    @Override
    public void sendData(GamePlayer player) {

    }
}
